﻿// //  ********************************************************************************
// //  Copyright (C) 2016 Sebastian Kenter. All rights reserved.
// // 
// //  Name    : MultiServerEngine | ServerFramework | RegisterSubServerResponseOperation.cs
// //  Created : 2016 - 02 - 16 20:53
// //  Modified: 2016 - 02 - 20 12:33
// //  ********************************************************************************

using Photon.SocketServer;
using Photon.SocketServer.Rpc;
using ServerFramework.Interfaces.Telegram;
using TypeDefs;

namespace ServerFramework.Implementation.Operations.Response
{
    public class RegisterSubServerResponseOperation : Operation
    {
        [DataMember(Code = (byte) ParameterCodes.PeerId, IsOptional = false, Name = "PeerId")]
        public string PeerId { get; set; }

        [DataMember(Code = (byte) ParameterCodes.PeerType, IsOptional = false, Name = "PeerType")]
        public byte PeerType { get; set; }

        [DataMember(Code = (byte) ParameterCodes.SubCode, IsOptional = false, Name = "OperationSubCode")]
        public int SubCode { get; set; }

        [DataMember(Code = 4, IsOptional = true)]
        public short ReturnCode { get; set; }

        public RegisterSubServerResponseOperation(IRpcProtocol protocol, ITelegram telegram)
            : base(protocol, new OperationRequest(telegram.Code, telegram.Parameters))
        {
        }

        public RegisterSubServerResponseOperation()
        {
        }
    }
}
